﻿#include <iostream>
#include <locale>
#include <vector>

using namespace std;
void c11Test()
{
	/*
	vector<int> v {1,2,3};
	for(int i: v)
	{
		cout<<i<<endl;
	}
	*/
}
/*
void testCLocal()
{
    char str[]="中国china";
     wchar_t str_w[]=L"中国china";

     int len=(int)strlen(str);
     int len_w=(int)wcslen(str_w);
     printf("%s,size=%d\n",str,len);

     setlocale(LC_ALL, "chs");
     wprintf(L"%s,size=%d\n",str_w,len_w);
}
*/
void testCppLocale()
{
	wchar_t ws[] = L"你好";
	wcout.imbue(locale("chs"));
	wcout<<ws<<endl;
	cout.setf(ios::hex, ios::basefield);
	for( int i = 0; i< sizeof(ws)/sizeof(wchar_t);i++)
	{
		wchar_t c = ws[i];
		cout<<c<<" ";
	}
	cout<<endl;
}
int main(void)
{
    //testCLocal();
	testCppLocale();
    return 0;
}
